//
// Created by ap on 2021/5/21.
//



#ifndef JNICALLBACKTEST_EVENTMANAGER_H
#define JNICALLBACKTEST_EVENTMANAGER_H

#endif

#include <map>


typedef void (*onSleepWake)(int code, void* sender);

enum EventEnum {
    eeSleepWake,
};

struct EventData {
    void* eventPointer;
    void* sender;
};

class EventManager {
public:
    static EventManager& singleton()
    {
        static EventManager sl;
        return sl;
    }
    static EventManager& getInstance()
    {
        return singleton();
    }

    //注册事件
    void addEvent(EventEnum eventEnum, void* event, void* sender);

    EventData getEventData(EventEnum eventEnum);

private:
    std::map<EventEnum, EventData> eventMap;
    EventManager(){};
    ~EventManager(){};
};
